﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Design;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
using HML.Design;

namespace HML.Demo
{
    public class TabControlPlusExt : TabControlPlus
    {
        public TabControlPlusExt() : base()
        {

        }

        protected override void OnTabItemDrawBackgroundAfter(TabControlPlusTabItemDrawBackgroundAfterEventArgs e)
        {
            base.OnTabItemDrawBackgroundAfter(e);
            SolidBrush line_sb = new SolidBrush(this.StyleAppearance.BackColor);
            e.Graphics.FillRectangle(line_sb, e.ClipBounds_P);
            if (this.TabPages[this.SelectedIndex] == e.TabPage && e.TabPage != null)
            {
                int height = (int)(Math.Ceiling(3 * this.ScaleDpi));
                line_sb.Color = this.StyleAppearance.TabBar.TabItem.Selected.BackColor;
                e.Graphics.FillRectangle(line_sb, new RectangleF(e.ClipBounds_P.X, e.ClipBounds_P.Bottom - height, e.ClipBounds_P.Width, height));
            }
            line_sb.Dispose();
        }

    }

}
